home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: netcom.com!boyse
- From: boyse@netcom.com (William Boyse)
- Subject: g++ 2.5.8 -> 2.7.0 Syntax Error
- Message-ID: <boyseDozKHC.JyA@netcom.com>
- Organization: NETCOM On-line Communication Services (408 261-4700 guest)
- X-Newsreader: TIN [version 1.2 PL1]
- Date: Thu, 28 Mar 1996 16:29:35 GMT
- Sender: boyse@netcom23.netcom.com
-
- I up(down?)graded my Linux OS and got g++ 2.7.0. I had been using
- 2.5.8. My finite element code would not compile due to various changes
- in the compiler. I fixed them all bug one. For the life of me I can't
- see what's wrong. Please help! The following is the rendered code and
- compiler output.
-
- // Definition of Lagrangian finite element classes
-
- #include <stdlib.h>
-
- enum Elt_Type {None, Tri_3, Tri_6, Quad_4, Tet_4};
-
- // Base class for elements
- class Element
- {
- public:
-
- int elt_number; // element number
- Elt_Type elt_type; // element type
- int n_nodes; // number of nodes
- int prop_id; // property ID
- int surf_id; // surface property ID
- int *nodes; // [n_nodes]
- float **node_coord; // [n_nodes] [3]
-
- Element(void)
- : elt_number(0), elt_type(None), n_nodes(0),
- nodes(NULL), node_coord(NULL) {}; // Default constructor
- };
-
- // 6 node triangular element
- class Tri_6 : public Element
- {
- public:
- Tri_6(void) : Element() {}; // Default Constructor
- };
-
- // Element Utility Routines
- Element *Next_Element(Element *ptr_elt)
- {
- ptr_elt = new Tri_6(); // ******* THIS IS THE OFFENDING LINE ********
- return ptr_elt;
- }
- cd ~/fem++/src/bug/
- make -k elt_class.o
- g++ -c elt_class.cc -o elt_class.o
- elt_class.cc: In function `class Element * Next_Element(class Element *)':
- elt_class.cc:35: parse error before `('
- make: *** [elt_class.o] Error 1
-
- Compilation exited abnormally with code 2 at Thu Mar 28 08:13:19
-
-
-